package rxclass;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import tool.Lg;

public abstract class TableObserver<T> implements Observer<T>{
    private long start;
    private String info;
    private int i = 0;
    public TableObserver(long start)
    {
        this.start = start;
    }

    public TableObserver(long start,String info)
    {
        this.start = start;
        this.info = info;
    }



    @Override
    public void onSubscribe(Disposable d) {

    }
    public void count()
    {
        i++;
    }

    @Override
    public void onError(Throwable e) {

    }

    @Override
    public void onComplete() {
        long end = System.currentTimeMillis();
        Lg.info("this batch is over,have " + i +" line data.");
        Lg.outputRuntime(start,end);
    }
}
